<template>
	<view class="flex flex-col pt80 px50">
		<view class="fs28 ">
			当前绑定手机号
		</view>
		<view class="fs40 fw-700 color-yellow mt20">
			{{$user.mobile}}
		</view>
		<view class="p10 pl30 pr30 w-max bg-f8f radius20 flex row-between" v-if="type" :class="type?'mt64':''">
			<u-input v-model="code" class="flex1" placeholder="请输入短信验证码"></u-input>
			<tips :mobile="$user.mobile" type="change"></tips>
		</view>
		<view class=" h84 radius12 bg-zs fs30 color-fff  w-max flex row-center" @click="type?submit():type=1"
			:class="type?'mt50':'mt110'">
			{{type?'确定':'更换手机号'}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				type: 0,
				code: ''
			};
		},
		methods: {
			submit() {
				let params = {
					mobile: this.$user.mobile,
					code: this.code,
				}
				this.$request('/member/my/changeMobile', params).then(res => {
					this.$u.route('/pages/my/bindMobile/changeMobile', {
						code: params.code
					})
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FFFFFF;
	}
</style>
